import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
]

const router = new VueRouter({
  routes:[
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/login/LoginIndex.vue')
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('../views/login/RegisterView.vue')
    },
    {
      path: '/index',
      name: 'index',
      component:  () => import( '../views/tlias/index.vue')
    },
    {
      path: '/content/:id',
      name: 'content',
      component: () => import( '../views/contentView.vue')
    },
    {
      path: '/product/:id',
      name: 'ProductDetail',
      component: () => import( '../views/product/ProductDetail.vue')
    },
    {
      path: '/productMore',
      name: 'productMore',
      component: () => import( '../views/product/ProductMore.vue')
    },
    {
      path: '/education',
      name: 'education',
      component: () => import( '../views/EducationView.vue')
    },
    {
      path: '/user',
      name: 'user',
      component: () => import( '../views/UserView.vue')
    },
    {
      path: '/userOrder',
      name: 'userOrder',
      component: () => import( '../views/user/UserOrder.vue')
    },
    {
      path: '/learn',
      name: 'learn',
      component: () => import( '../views/Myuser/LearingView.vue')
    },
    {
      path: '/history',
      name: 'history',
      component: () => import( '../views/Myuser/HistoryView.vue')
    },
    {
      path: '/name',
      name: 'name',
      component: () => import( '../views/RealName.vue')
    },
    {
      path: '/setup',
      name: 'setup',
      component: () => import( '../views/user/SetupView.vue')
    },
    {
      path: '/my',
      name: 'my',
      component: () => import( '../views/user/MyView.vue')
    },
    {
      path: '/updatePwd',
      name: 'updatePwd',
      component: () => import( '../views/user/updatePwd.vue')
    },
    {
      path: '/',
      redirect: '/index'
    },
  ],
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 };
  }
})

export default router
